package com.d0323;
public class Course {
    private String title;
    private double price;

    public Course(String title,double price){
        this.title = title;
        this.price = price;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (this.getClass () != obj.getClass ()) {
            return false;
        }
        Course course = (Course) obj;
        if (title == null) {
            if (course.title != null) {
                return false;
            }
        } else if (!title.equals ( course.title )) {
            return false;
        }
        return true;
    }
    public static void main(String[] args) {
        Course c1 = new Course ("math",100);
        Course c2 = new Course (  "math",100);
        System.out.println ( c1 == c2 );
        System.out.println ( c1.equals ( c2 ) );
    }
}